<template>
  <div class="settings">
    <van-nav-bar safe-area-inset-top placeholder :title="$t('SuperSetting')" left-arrow fixed @click-left="onClickLeft" />
    <van-pull-refresh v-model="isLoading" :pulling-text="$t('PullingText')" :loosing-text="$t('PullingText')" :success-text="$t('refreshSuccee')" @refresh="onRefresh">
      <van-collapse class="marginTop15" v-model="activeNames">
        <van-collapse-item :title="$t('Reset')" name="1">
          <resetErrorLogsVue :setName="$t('Restorefactorysettings')" :subOption="'Restorefactorysettings'"></resetErrorLogsVue>
        </van-collapse-item>
      </van-collapse>
    </van-pull-refresh>
  </div>
</template>

<script>
import resetErrorLogsVue from '../../../components/ResetErrorLogs/ResetErrorLogs'

export default {
  components:{
    resetErrorLogsVue
  },
  data(){
    return {
      isLoading:false,
      activeNames:[]
    }
  },
  methods: {
    onClickLeft(){
      this.$router.push({path:'/setting'});
    },
    async getData(){
      this.comm.loadingShow();
      let datas=await this.SETAPI.setGetData(localStorage.getItem('domain'),{'tokenId':localStorage.getItem('tokenId'),'sn':localStorage.getItem('wifiSN')});
      if(datas.result!=null&&datas.result!="tokenId不合法!"){
        let dataArr = JSON.parse(datas.result);
      }else{
        this.comm.tipsShow('InvNoResponse');
      }
    },
    onRefresh(){
      this.isLoading = false;
      this.getData();
    }
  },
  mounted(){
    this.getData();
  }
}
</script>

<style scoped lang="less">

</style>
